package com.atguigu.gulimall.search.vo;

import com.atguigu.common.to.es.EsSkuUpTo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author zhuguanming
 * @description 检索结果
 * @date 2021/5/31 21:50
 */
@Data
public class SearchResult {
    /**
     * 查询到的所有商品信息
     */
    private List<EsSkuUpTo> products;

    private Integer pageNum;
    private Long total;
    private Integer totalPages;

    /**
     * 当前查询到的所有商品信息涉及到的品牌、分类、属性
     */
    private List<BrandVo> brands;
    private List<CatalogVo> catalogs;
    private List<AttrVo> attrs;

    private List<Integer> pageNavs;

    /**
     * 筛选条件面包屑
     */
    private List<NavVo> navVos;
    /**
     * 请求参数中的属性ID值
     */
    private List<Long> attrIds;


    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class NavVo{
        private String attrName;
        private String attrValue;
        private String toLink;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class BrandVo{
        private Long brandId;
        private String brandName;
        private String brandImg;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class CatalogVo{
        private Long catalogId;
        private String catalogName;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class AttrVo{
        private Long attrId;
        private String attrName;
        private List<String> attrValue;
    }
}
